package sitemaps;

import java.beans.XMLDecoder;
import java.io.IOException;
import java.io.InputStream;

public class ResourceLoader {
    
    public Object load(String resourceName) throws IOException {
        XMLDecoder dec = null;
        InputStream is = null;
        try {
            is = getClass().getResourceAsStream(resourceName);
            dec = new XMLDecoder(is);
            return dec.readObject();
        } finally {
        	try {
	            if(dec != null) dec.close();
        	} finally {
	            if(is != null) is.close();
        	}
        }
    }

}
